package com.study.demo_resttemplate.demo;

import com.study.demo_resttemplate.entity.interfaceentity.IntefaceApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

/**
 * @Name: RestTemplateTest
 * @Description: java类作用描述
 * @Author: yn
 * @CreateDate: 2022/7/15 11:38
 * @Remark: 特殊说明
 * @Version: 1.0
 */
@Component
public class NFTInteface {
    @Autowired
    @Qualifier("restTemplateWithInterceptors")
    RestTemplate restTemplate;

    @Autowired
    SDKInteface sdkInteface;

    private String API_BASE="https://open.zxchain.qq.com/";

    public IntefaceApi claimSeries(Integer totalCount, String pubKey, String platformPubKey, String seriesName, String operateId, String coverUrl, String desc,
                                   String maxPublishCount, String seriesBeginFromZero, String signature, String platformSignature){
        Map<String,Object> request = new HashMap<>();
        request.put("pubKey",pubKey);
        request.put("platformPubKey",platformPubKey);
        request.put("seriesName",seriesName);
        request.put("totalCount",totalCount);
        request.put("operateId",operateId);
        request.put("coverUrl",coverUrl);
        request.put("desc",desc);
        request.put("maxPublishCount",maxPublishCount);
        request.put("seriesBeginFromZero",seriesBeginFromZero);
        request.put("signature",signature);
        request.put("platformSignature",platformSignature);
        return restTemplate.postForObject(API_BASE + "api/v1/nft/series/claim", request, IntefaceApi.class);
    }
}
